home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Arsenal Files 4
/
The Arsenal Files 4 (Arsenal Computer).ISO
/
casm
/
au116-as.exe
/
UTIL
/
PERCENT.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-12-05
|
565b
|
24 lines
#include "..\au.hpp"
/**********************************************************************/
char *percent_string(long uncomp, long comp)
{
static char string[10];
if (uncomp == comp)
return " 0.0";
if (uncomp == 0)
return " ---";
if (comp/uncomp > 9)
return " -Big";
if (uncomp>1000000l)
ltoa(1000l-(comp/(uncomp/1000l)), string, 10);
else if (uncomp!=0)
ltoa(1000l-(comp*1000l/uncomp), string ,10);
strcpy(string, left_pad(string, 5));
string[6] = '\0';
string[5] = string[4];
string[4] = '.';
return string;
}